﻿@page
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Volo.Abp.Identity
@using Volo.Abp.Identity.Localization
@using Volo.Abp.Identity.Web.Navigation
@using Volo.Abp.Extension.Web.Pages.Identity.Users
@model IndexModel
@inject IHtmlLocalizer<IdentityResource> L
@inject IAuthorizationService Authorization
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["Users"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:IdentityManagement"].Value);
    PageLayout.Content.MenuItemName = IdentityMenuNames.Users;
}
@section styles {
    <abp-style-bundle name="@typeof(IndexModel).FullName">
        <abp-style src="/Pages/AbpPermissionManagement/permission-management-modal.css" />
    </abp-style-bundle>
}
@section scripts {
    <abp-script-bundle name="@typeof(IndexModel).FullName">
        <abp-script src="/Pages/AbpPermissionManagement/permission-management-modal.js" />
        <abp-script src="/Pages/identity/users/index.js" />
    </abp-script-bundle>
}

<div id="IdentityUsersWrapper">

    <abp-row class="mb-3">
        <abp-column size-md="_6">
            <h1 class="h3  text-gray-800">@L["Users"]</h1>
        </abp-column>
        <abp-column size-md="_6" class="text-right">
            @if (await Authorization.IsGrantedAsync(IdentityPermissions.Users.Create))
            {
                <abp-button button-type="Primary" name="CreateUser" text="@L["NewUser"].Value" icon="plus" />
            }
        </abp-column>
    </abp-row>

    <abp-card class="shadow">
        <abp-card-body>

            <abp-table striped-rows="false" class="nowrap" border-style="Bordered" responsive="true">
                <thead>
                    <tr>
                        <th>@L["UserName"]</th>
                        <th>@L["Name"]</th>
                        <th>@L["EmailAddress"]</th>
                        <th>@L["PhoneNumber"]</th>
                        <th>@L["Actions"]</th>
                    </tr>
                </thead>
            </abp-table>

        </abp-card-body>
    </abp-card>

</div>